import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @Description: 创建自定义工作job
 * @Auther: dongwq
 * @Date: 2021/5/27 11:19
 * @company：CTTIC
 */
public class MyJob implements Job {

    private static final Logger logger = LoggerFactory.getLogger(MyJob.class);

    //execute方法执行业务逻辑
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("start  execute ...");
        String printTime = new SimpleDateFormat("yy-MM-dd HH-mm-ss").format(new Date());
        logger.info("PrintWordsJob start at:" + printTime + ", prints: Hello Job-" + new Random().nextInt(100));
    }
}
